
.PHONY: all dist

working_dir := ${shell pwd}
build_dir := build


all: dist


# 'make dist' is just a synonym for 'make cmake'
dist: cmake


# 'make cmake' does a basic build (after first setting it up)
cmake: cmakesetup
	( cd ${build_dir}; make )


# 'make cmakesetup' constructs the build directory and runs 'cmake'
# there, generating makefiles to build the project.
cmakesetup:
	cmake -E  make_directory ${build_dir}
	( cd ${build_dir}; \
	  cmake -DCMAKE_INSTALL_PREFIX=${working_dir}/${build_dir} ../src )


debug:
	${MAKE} DEBUG=1 --no-print-directory